package com.dbqn.zhao.service.impl;

import com.dbqn.zhao.service.BaseService;
import com.dbqn.zhao.util.serviceFactory;

import java.util.List;
import java.util.Scanner;

public class StartServesImpl implements BaseService {

        Scanner sc=new Scanner(System.in);

    @Override
    public List excute(List list) {

        for(;;){
            System.out.println("*******欢迎使用 “ 裹裹快投 ” 服务软件*******");
            System.out.println("1.我要寄件  2.查询订单  3.修改订单  4.取消订单 5.查询常用联系人  6.退出系统");
            System.out.println("请选择:(1~6)：");
            //郑州市中原区伏牛路53号院13409280933/栋栋
            switch (sc.nextInt()){

                case 1:
                    //我要寄件
                    BaseService baseService= serviceFactory.getService("mail");
                    baseService.excute(list);
                    break;

                case 2:
                    BaseService baseService2= serviceFactory.getService("select");
                    baseService2.excute(list);
                    break;

                case 3:
                    BaseService baseService3= serviceFactory.getService("update");
                    baseService3.excute(list);
                    break;

                case 4:
                    BaseService baseService4= serviceFactory.getService("delete");
                    baseService4.excute(list);
                    break;

                case 5:
                    BaseService baseService5= serviceFactory.getService("select2");
                    baseService5.excute(list);
                    break;

                case 6:
                    System.out.println("欢迎下次光临！");
                    System.exit(1);//关闭虚拟机，结束程序

                default:
                    System.out.println("请输入正确序号！");
                    break;

            }



        }


    }



}
